package com.gui.reflection;

import com.gui.entity.Person;

public class ReflectionClassApi2Demo {

    public static void main(String[] args) throws ClassNotFoundException {

        // 获取反射的几种方式
        System.out.println(Person.class.getCanonicalName());
        Person person = new Person();
        System.out.println(person.getClass().getCanonicalName());
        Class<?> aClass = Class.forName("com.gui.entity.Person");
        System.out.println(aClass.getCanonicalName());
        Class<?> klass = ClassLoader.getSystemClassLoader().loadClass("com.gui.entity.Person");
        System.out.println(klass.getCanonicalName());
    }
}
